// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`constructorDefaultValuesReferencingThis.ts 1`] = `
class C {
    constructor(x = this) { }
}

class D<T> {
    constructor(x = this) { }
}

class E<T> {
    constructor(public x = this) { }
}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class C {
  constructor(x = this) {}
}

class D<T> {
  constructor(x = this) {}
}

class E<T> {
  constructor(public x = this) {}
}

`;

exports[`constructorImplementationWithDefaultValues.ts 1`] = `
class C {
    constructor(x);
    constructor(x = 1) {
        var y = x;
    }
}

class D<T> {
    constructor(x);
    constructor(x:T = null) {
        var y = x;
    }
}

class E<T extends Date> {
    constructor(x);
    constructor(x: T = null) {
        var y = x;
    }
}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class C {
  constructor(x);
  constructor(x = 1) {
    var y = x;
  }
}

class D<T> {
  constructor(x);
  constructor(x: T = null) {
    var y = x;
  }
}

class E<T extends Date> {
  constructor(x);
  constructor(x: T = null) {
    var y = x;
  }
}

`;

exports[`constructorImplementationWithDefaultValues2.ts 1`] = `
class C {
    constructor(x);
    constructor(public x: string = 1) {
        var y = x;
    }
}

class D<T, U> {
    constructor(x: T, y: U);
    constructor(x: T = 1, public y: U = x) {
        var z = x;
    }
}

class E<T extends Date> {
    constructor(x);
    constructor(x: T = new Date()) {
        var y = x;
    }
}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class C {
  constructor(x);
  constructor(public x: string = 1) {
    var y = x;
  }
}

class D<T, U> {
  constructor(x: T, y: U);
  constructor(x: T = 1, public y: U = x) {
    var z = x;
  }
}

class E<T extends Date> {
  constructor(x);
  constructor(x: T = new Date()) {
    var y = x;
  }
}

`;

exports[`constructorOverloadsWithDefaultValues.ts 1`] = `
class C {
    foo: string;
    constructor(x = 1);
    constructor() {
    }
}

class D<T> {
    foo: string;
    constructor(x = 1);
    constructor() {
    }
}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class C {
  foo: string;
  constructor(x = 1);
  constructor() {}
}

class D<T> {
  foo: string;
  constructor(x = 1);
  constructor() {}
}

`;

exports[`constructorOverloadsWithOptionalParameters.ts 1`] = `
class C {
    foo: string;
    constructor(x?, y?: any[]); 
    constructor() {
    }
}

class D<T> {
    foo: string;
    constructor(x?, y?: any[]); 
    constructor() {
    }
}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class C {
  foo: string;
  constructor(x?, y?: any[]);
  constructor() {}
}

class D<T> {
  foo: string;
  constructor(x?, y?: any[]);
  constructor() {}
}

`;

exports[`constructorParameterProperties.ts 1`] = `
class C {
    y: string;
    constructor(private x: string, protected z: string) { }
}

var c: C;
var r = c.y;
var r2 = c.x; // error
var r3 = c.z; // error

class D<T> {
    y: T;
    constructor(a: T, private x: T, protected z: T) { }
}

var d: D<string>;
var r = d.y;
var r2 = d.x; // error
var r3 = d.a; // error
var r4 = d.z; // error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class C {
  y: string;
  constructor(private x: string, protected z: string) {}
}

var c: C;
var r = c.y;
var r2 = c.x; // error
var r3 = c.z; // error

class D<T> {
  y: T;
  constructor(a: T, private x: T, protected z: T) {}
}

var d: D<string>;
var r = d.y;
var r2 = d.x; // error
var r3 = d.a; // error
var r4 = d.z; // error

`;

exports[`constructorParameterProperties2.ts 1`] = `
class C {
    y: number;
    constructor(y: number) { } // ok
}

var c: C;
var r = c.y;

class D {
    y: number;
    constructor(public y: number) { }
}

var d: D;
var r2 = d.y;

class E {
    y: number;
    constructor(private y: number) { }
}

var e: E;
var r3 = e.y; // error

class F {
    y: number;
    constructor(protected y: number) { }
}

var f: F;
var r4 = f.y; // error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class C {
  y: number;
  constructor(y: number) {} // ok
}

var c: C;
var r = c.y;

class D {
  y: number;
  constructor(public y: number) {}
}

var d: D;
var r2 = d.y;

class E {
  y: number;
  constructor(private y: number) {}
}

var e: E;
var r3 = e.y; // error

class F {
  y: number;
  constructor(protected y: number) {}
}

var f: F;
var r4 = f.y; // error

`;

exports[`declarationEmitReadonly.ts 1`] = `
// @declaration: true

class C {
    constructor(readonly x: number) {}
}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// @declaration: true

class C {
  constructor(readonly x: number) {}
}

`;

exports[`readonlyConstructorAssignment.ts 1`] = `
// Tests that readonly parameter properties behave like regular readonly properties

class A {
    constructor(readonly x: number) {
        this.x = 0;
    }
}

class B extends A {
    constructor(x: number) {
        super(x);
        // Fails, x is readonly
        this.x = 1;
    }
}

class C extends A {
    // This is the usual behavior of readonly properties:
    // if one is redeclared in a base class, then it can be assigned to.
    constructor(readonly x: number) {
        super(x);
        this.x = 1;
    }
}

class D {
    constructor(private readonly x: number) {
        this.x = 0;
    }
}

// Fails, can't redeclare readonly property
class E extends D {
    constructor(readonly x: number) {
        super(x);
        this.x = 1;
    }
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Tests that readonly parameter properties behave like regular readonly properties

class A {
  constructor(readonly x: number) {
    this.x = 0;
  }
}

class B extends A {
  constructor(x: number) {
    super(x);
    // Fails, x is readonly
    this.x = 1;
  }
}

class C extends A {
  // This is the usual behavior of readonly properties:
  // if one is redeclared in a base class, then it can be assigned to.
  constructor(readonly x: number) {
    super(x);
    this.x = 1;
  }
}

class D {
  constructor(private readonly x: number) {
    this.x = 0;
  }
}

// Fails, can't redeclare readonly property
class E extends D {
  constructor(readonly x: number) {
    super(x);
    this.x = 1;
  }
}

`;

exports[`readonlyInConstructorParameters.ts 1`] = `
class C {
    constructor(readonly x: number) {}
}
new C(1).x = 2;

class E {
    constructor(readonly public x: number) {}
}

class F {
    constructor(private readonly x: number) {}
}
new F(1).x;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class C {
  constructor(readonly x: number) {}
}
new C(1).x = 2;

class E {
  constructor(public readonly x: number) {}
}

class F {
  constructor(private readonly x: number) {}
}
new F(1).x;

`;

exports[`readonlyReadonly.ts 1`] = `
class C {
    readonly readonly x: number;
    constructor(readonly readonly y: number) {}
}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class C {
  readonly x: number;
  constructor(readonly y: number) {}
}

`;
